<?php
include('../../inc/global.inc');
include("../islogin.php");
$url=$_SERVER['HTTP_REFERER'];
?>
<?php
if($_POST[act_tj]){
mysql_query("insert into web_a_list (web_list_name,web_list_type) values ('$_POST[web_list_name]','$_POST[web_list_type]')");
echo "<script>location='".$_POST[url]."';</script>";
}
?>
<?php
if($_POST['act_xg']){
mysql_query("update web_a_list set web_list_name='$_POST[web_list_name]',web_list_type='$_POST[web_list_type]' where id='".$_POST['iid']."'");

echo "<script>location='".$_POST[url]."';</script>";
}
?>
<HTML>
<HEAD>
<TITLE>Admin</TITLE>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<LINK href="../css/css.css" rel=stylesheet>
<script type='text/javascript' src="../js/islogin.js" charset="gb2312"></script>
</HEAD>
<BODY>
<center>
  <table width="600" border="0" cellpadding="0" cellspacing="1" bgcolor="#000000">
    <tr>
      <td height="25" bgcolor="#EEEEF9" style="padding-left:5px;">添加、修改会员网站配置&nbsp;&nbsp;<a href="javascript:history.go(-1)">返回</a></td>
    </tr>
  </table>
<?php
if($_GET[tj]){
?>
  <table width="600" border="0" cellpadding="0" cellspacing="1" bgcolor="#000000">
  <form method="post" action="" onSubmit="return check()" name="form1">
    <tr>
      <td height="30" colspan="2" align="center" bgcolor="#8DA8CF">添加会员网站配置</td>
    </tr>
    <tr>
      <td width="26%" height="30" align="center" bgcolor="#FFFFFF">会员网站配置名称</td>
      <td width="74%" align="left" bgcolor="#FFFFFF" style="padding-left:2px;"><input name="web_list_name" type="text" id="web_list_name" size="30" maxlength="100"></td>
    </tr>
    <tr>
      <td width="26%" height="30" align="center" bgcolor="#FFFFFF">展示类型</td>
      <td width="74%" align="left" bgcolor="#FFFFFF" style="padding-left:2px;">
	  <select name="web_list_type" id="web_list_type">
	    <option value="1">新闻展示</option>
		<option value="2">图片展示</option>
	  </select></td>
    </tr>
    <tr><input type="hidden" name="url" value="<?=$url?>">
	<input type="hidden" name="act_tj" value="ok">
      <td height="30" colspan="2" align="center" bgcolor="#FFFFFF"><input type="submit" value="提交"></td>
    </tr>
	</form>
  </table>
  <?php
}
?>
  <?php
if($_GET['xg']){
$sql="select * from web_a_list where id=".$_GET['xg_id'];
$rs=mysql_query($sql);
$row=mysql_fetch_array($rs)
?>
<table width="600" border="0" cellpadding="0" cellspacing="1" bgcolor="#000000">
    <form method="post" action="" onSubmit="return check()" name="form1">
      <tr>
        <td height="30" colspan="2" align="center" bgcolor="#8DA8CF">修改会员网站配置</td>
      </tr>
      <tr>
        <td width="27%" height="30" align="center" bgcolor="#FFFFFF">会员网站配置名称</td>
        <td width="74%" align="left" bgcolor="#FFFFFF" style="padding-left:2px;"><input name="web_list_name" type="text" value="<?=$row[web_list_name]?>" size="30" maxlength="100"></td>
      </tr>
	  <tr>
      <td width="26%" height="30" align="center" bgcolor="#FFFFFF">展示类型</td>
      <td width="74%" align="left" bgcolor="#FFFFFF" style="padding-left:2px;">
	  <select name="web_list_type" id="web_list_type">
	    <option value="1" <?php if($row[web_list_type]==1){echo "selected";}?>>新闻展示</option>
		<option value="2" <?php if($row[web_list_type]==2){echo "selected";}?>>图片展示</option>
	  </select></td>
    </tr
      ><tr><input type="hidden" name="url" value="<?=$url?>">
        <input type="hidden" name="act_xg" value="ok"><input type="hidden" name="iid" value="<?=$row['id']?>">
        <td height="30" colspan="2" align="center" bgcolor="#FFFFFF"><input name="submit" type="submit" value="提交"></td>
      </tr>
    </form>
  </table>
  <?php
}?>
</center>
</BODY>
</HTML>

<script language="javascript">
function $(id){
return document.getElementById(id);
}
function check(){
if($("web_list_name").value==""){
alert("名称不能为空");
$("web_list_name").focus();
return false;
}
}
</script>